package com.zeng.bean;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.beans.factory.annotation.Value;

/**
 * @author Zqm
 * @Title: Person
 * @ProjectName SpringAnnotationDriven
 * @date 2019/1/10
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Person {

    /**
     * @Value赋值
     * 1.基本参数
     * 2.spring自带 SpEL表达式 #{}
     * 3.可以写${}  取出环境变量里面的值
     */

    @Value("张三")
    private String name;

    @Value("#{20-2}")
    private Integer age;

    @Value("${person.nickName}")
    private String nickName;
}
